import cv2
import numpy as np
video_path=r'E:\pythonprojectnew\graduation\CarLaneDetection-master\resources\v2.mp4'
cap = cv2.VideoCapture(video_path)

fourcc = cv2.VideoWriter_fourcc(*'MJPG')
vout = cv2.VideoWriter('test' + '.avi', fourcc, 30.0, (1920, 1080))
while(1):
    # get a frame
    ret, frame = cap.read()
    # show a frame
    cv2.imshow("capture", frame)
    if cv2.waitKey(30) & 0xFF == ord('q'):
        break
    vout.write(frame)
vout.release()
cap.release()
cv2.destroyAllWindows()
